<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<title>凑字数器</title>   
 <meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://shc7432.github.io/public/something/sometool.js"></script>
<script src="https://shc7432.github.io/public/something/other/userdata.js"></script>
<script src="https://shc7432.github.io/public/something/other/anonymous.js"></script>
  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script src="https://shc7432.github.io/public/getLinkInput/getLinkInput.js"></script>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://shc0743.github.io/crypto-js/core.js"></script>
<script src="https://shc0743.github.io/crypto-js/enc-base64.js"></script>
<script src="https://shc0743.github.io/crypto-js/enc-hex.js"></script>
<script src="https://shc0743.github.io/crypto-js/enc-utf8.js"></script>
<script src="https://shc0743.github.io/crypto-js/enc-utf16.js"></script>
<script src="https://shc0743.github.io/crypto-js/crypto-js.js"></script>
<script src="https://shc0743.github.io/crypto-js/aes.js"></script>
<script src="https://shc0743.github.io/crypto-js/md5.js"></script>
<script src="https://shc0743.github.io/crypto-js/sha1.js"></script>
<script src="https://shc0743.github.io/crypto-js/sha512.js"></script>
<script src="https://pv.sohu.com/cityjson"></script>
<script>
  window.getip=window.getIP=function(){
    return returnCitySN.cip;
  }
function getRandom(min, max) {
    return Math.floor(Math.random() * (max - min + 1) ) + min;
}
nbsp10="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
nbsp10="";
</script>
</head>
<body>

<h1>凑字数器</h1>
<div style="border:1px solid #ccc;">
<span onclick="count.focus()">凑<span style="width:20px;border:1px solid #888;" id=count 
onfocus="this.select()" contenteditable></span>个字</span><br>
<span id=create>生成</span> &nbsp; &nbsp; <span id=copy>复制</span> &nbsp; &nbsp; 
<span id=rst style="background-color: #7fcaff;">重置</span> <br>
<script src="https://shc7432.github.io/public/something/other/userdata.js"></script>
<div class=userdata></div>
</div>

<script>
(function(){
create.style.backgroundColor="#7fcaff";
copy.style.backgroundColor="#ccc";
btnsStatus={create: 1,copy: 0};
befinput="";

/*count.oninput=function(){
if(isNaN(Number(this.innerHTML.replace(befinput,"")))){
this.innerHTML=befinput;
} else {befinput=this.innerHTML}
}*/

create.onclick=function(){
if(btnsStatus.create){
btnsStatus.create=0;
create.style.backgroundColor="#ccc";
var str="";
count.innerHTML=count.innerHTML.replace(/\u0020/g,"");
count.innerHTML=count.innerHTML.replace(new RegExp("&nbsp;","g"),"");
if(count.innerHTML=="") count.innerHTML=nbsp10;
if(isNaN(Number(count.innerHTML))){
this.innerHTML="生成失败,原因:输入不是数字";
setTimeout(function(){
create.innerHTML="生成";
create.style.backgroundColor="#7fcaff";
btnsStatus.create=1;
},2000)
return;
}
for(let i=0;i<parseInt(count.innerHTML);i++){
str+="⁠";
}
out=str;
copy.style.backgroundColor="#7fcaff";
btnsStatus.copy=1;
 }
}
copy.onclick=function(){
if(btnsStatus.copy){
copytext(out);
this.innerHTML="复制成功";
setTimeout(function(){copy.innerHTML="复制"},2000)
 }
}
rst.onclick=function(){
create.style.backgroundColor="#7fcaff";
copy.style.backgroundColor="#ccc";
btnsStatus={create: 1,copy: 0};
}

})()
</script>

</body>
</html>
